﻿<!-- "script/apps/Aries/Creator/Game/Tasks/Friend/KeepWorkMallPage.html" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<pe:mcml>
<script refresh="true" type="text/npl" src="KeepWorkMallPage.lua"><![CDATA[
local KeepWorkMallPage = NPL.load("(gl)script/apps/Aries/Creator/Game/KeepWork/KeepWorkMallPage.lua");
local KeepWorkItemManager = NPL.load("(gl)script/apps/Aries/Creator/HttpAPI/KeepWorkItemManager.lua");
KeepWorkMallPage.OnInit()
function ClosePage()
    Page:CloseWindow();
    KeepWorkMallPage.CloseView()
end
function OnChangeTopBt(index)
    KeepWorkMallPage.OnChangeTopBt(index);
end
function IsSelected(index)
    return KeepWorkMallPage.top_bt_index == index;
end
function TreeItems(index)
    return KeepWorkMallPage.menu_data_sources
end
function GridsItems(index)
    if(index == nil) then    
        return #KeepWorkMallPage.grid_data_sources;
    else
        return KeepWorkMallPage.grid_data_sources[index];
    end
end

function TypeBeExpand(expanded)
    if(expanded and expanded == true) then
        return true;
    else
        return false;
    end
end
function ItemBeSelected(type_index,menu_item_index)
    if(KeepWorkMallPage.menu_item_index == menu_item_index) then
        return true;
    else
        return false;
    end
end
function ChangeMenuType(treenode)
    local attr = treenode.mcmlNode:GetPreValue("this");
    KeepWorkMallPage.ChangeMenuType(attr.level, attr.index)
    
end
function ChangeMenuItem(name,mcmlNode)

    --local type_index = tonumber(mcmlNode:GetAttribute("param1"));
    --local menu_item_index = tonumber(mcmlNode:GetAttribute("param2"));

    local attr = mcmlNode:GetAttribute("param1")
    local menu_item_index = attr.menu_item_index
    KeepWorkMallPage.ChangeMenuItem(attr)
end

function OnSearch()
    if(virtual_key == Event_Mapping.EM_KEY_RETURN) then
        SearchProduct()
	end
end

function SearchProduct()
    local search_ctrl = Page:FindUIControl("block_search_text_ctl")
    KeepWorkMallPage.GetGoodsData(nil, search_ctrl.text, true)
end
function OnclickBuy(name,mcmlNode)
    --local exid = tonumber(mcmlNode:GetAttribute("param1"));
    local data = mcmlNode:GetAttribute("param1")
    KeepWorkMallPage.OnClickBuy(data)     
end

function getTopBtDesc()

    return KeepWorkMallPage.getTopBtDesc()
end

function IsShowFlag(data)
    if data.is_sell or data.is_has or data.can_use or data.is_use or data.vip_enabled then
        return true
    end

    return false
end

function IsOnlyNumber(desc)
    if type(tonumber(desc)) == "number" then
        return true
    end

    return false
end

]]></script>
<kp:window name="iframe" width="996" height="613" icon="Texture/Aries/Creator/keepwork/Window/title/biaoti_ziyuan_32bits.png" help_type="mall" onclose="ClosePage">
    <div style="color:#ffffff;" class="kp_window_container">
    <!-- <div style="margin-left:5px;margin-top:-2px;width:890px;height:57px;background-color:#3b3b3b;">
        <pe:if condition='<%= IsSelected(1)%>'>
            <div style="float:left;width:75px;height:36px;">
                <input type="button" name="1" value='<%=L"全部"%>' onclick="OnChangeTopBt" tooltip='<%=L"全部"%>' style="position:relative;width:70px;height:46px;margin-left:30px;margin-top:12px;color:#d56a00;font-size:16;" background=""/>
                <div style="float:left;width:75px;height:4px;margin-top:50px;margin-left:26px;background-color:#d56a00;"></div>
            </div>
        </pe:if>
        <pe:if condition='<%= not IsSelected(1)%>'>
            <div style="float:left;width:75px;height:36px;">
                <input type="button" name="1" value='<%=L"全部"%>' onclick="OnChangeTopBt" tooltip='<%=L"全部"%>' style="width:70px;height:46px;margin-left:30px;margin-top:12px;color:#ffffff;font-size:16;" background=""/>
            </div>
        </pe:if>

        <pe:if condition='<%= IsSelected(2)%>'>
            <div style="float:left;width:75px;height:36px;">
                <input type="button" name="2" value='<%=L"最新"%>' onclick="OnChangeTopBt" tooltip='<%=L"最新"%>' style="position:relative;width:70px;height:46px;margin-left:30px;margin-top:12px;color:#d56a00;font-size:16;" background=""/>
                <div style="float:left;width:75px;height:4px;margin-top:50px;margin-left:26px;background-color:#d56a00;"></div>
            </div>
        </pe:if>
        <pe:if condition='<%= not IsSelected(2)%>'>
            <div style="float:left;width:75px;height:36px;">
                <input type="button" name="2" value='<%=L"最新"%>' onclick="OnChangeTopBt" tooltip='<%=L"最新"%>' style="width:70px;height:46px;margin-left:30px;margin-top:12px;color:#ffffff;font-size:16;" background=""/>
            </div>
        </pe:if>

        <pe:if condition='<%= IsSelected(3)%>'>
            <div style="float:left;width:75px;height:36px;">
                <input type="button" name="3" value='<%=L"热门"%>' onclick="OnChangeTopBt" tooltip='<%=L"热门"%>' style="position:relative;width:70px;height:46px;margin-left:30px;margin-top:12px;color:#d56a00;font-size:16;" background=""/>
                <div style="float:left;width:75px;height:4px;margin-top:50px;margin-left:26px;background-color:#d56a00;"></div>
            </div>
        </pe:if>
        <pe:if condition='<%= not IsSelected(3)%>'>
            <div style="float:left;width:75px;height:36px;">
                <input type="button" name="3" value='<%=L"热门"%>' onclick="OnChangeTopBt" tooltip='<%=L"热门"%>' style="width:70px;height:46px;margin-left:30px;margin-top:12px;color:#ffffff;font-size:16;" background=""/>
            </div>         
        </pe:if>
    </div> -->

    <div style="margin-left:550px;margin-top:-30px;width:350px;">
        <!-- <div style="width:292px;height:27px;background:url(Texture/Aries/Creator/Desktop/Inventory_32bits.png#32 364 32 32:8 8 8 8);"> -->
            <div style="float: left;width:295px;height:22px;background:url(Texture/Aries/Creator/keepwork/Mall/shurubj_410X24_32bits.png#0 0 16 16:4 4 4 4);">
                <input type="text" EmptyText='<%=L"请输入你要搜索的内容"%>' name="block_search_text_ctl" uiname="block_search_text_obj" CaretColor="#FFFFFFFF" style="margin-left:5px;textcolor:#000000;wid;height:22px;background:;" onkeyup="OnSearch" />
            </div>
    
            <input type="button" value='搜索' onclick="SearchProduct" tooltip="搜索" style="float: left;color: #000000;margin-left: -7px; margin-top: 0px;font-size: 14pt;width: 55px;height: 25px; background:url(Texture/Aries/Creator/keepwork/friends/btn_shousuo_36X28_32bits.png#0 0 32 32:8 8 8 8)" />
    </div>

    <div style="margin-left: 0px;width:998px;height:17px;background:url(Texture/Aries/Creator/keepwork/Mall/zhuangshi_997X47_32bits.png#0 0 997 47);">

    </div>

    <div style="float:left;width:130px;height:460px;margin-left:15px;margin-top:18px;">
        <!-- <div style="margin-left:10px;padding-left:12px;font-size:14px;">
            <div style="height:18px;color:#ffffff;margin-top:25px;"><%=getTopBtDesc()%></div>
        </div> -->
        <pe:treeview name="tvwHelp" DataSource='<%=TreeItems()%>' OnClick="ChangeMenuType" ItemToggleSize="0" style="height:460px;margin-left:10px;margin-top:4px;background:" VerticalScrollBarOffsetX="6">
            <NodeTemplates>
                <NodeTemplate DataType="type">
                    <pe:treenode RenderTemplate="type_template" MouseOverBG="" expanded='<%=XPath("this|expanded")%>' can_select="true"></pe:treenode>
                </NodeTemplate>
                <NodeTemplate DataType="type_template">
                    <div style="height:36px">
                        
                        <div style="margin-left:0px;margin-top:7px;height:32px;width:96px;background:">
                            <input type="button" value='' zorder="-1" name='<%=XPath("this|index") %>' style="position:relative;margin-left:0px;width:96px;height:32px;font-weight:bold;background:url(Texture/Aries/Creator/keepwork/Mall/btn_qiehuan_32X32_32bits.png#0 0 32 32:8 8 8 8)" />
                            <div style="float:left;margin-left: -20px;margin-top: 3px;">
                                <div style="position:relative;margin-left: 18px;margin-top: 2px; text-align:center;color: #181818;"><%=XPath("this|text") %></div>
                                <pe:if condition='<%= TypeBeExpand(XPath("this|expanded")) == false %>'>
                                    <div style="position:relative;margin-left:94px;margin-top:7px;width:14px;height:8px;background:url(Texture/Aries/Creator/keepwork/Mall/icon_qiehuan1_14X8_32bits.png#0 0 14 8);" />
                                </pe:if>
                                <pe:if condition='<%= TypeBeExpand(XPath("this|expanded")) == true %>'>
                                    <div style="position:relative;margin-left:94px;margin-top:7px;width:14px;height:8px;background:url(Texture/Aries/Creator/keepwork/Mall/icon_qiehuan2_14X8_32bits.png#0 0 14 8);" />
                                </pe:if>
                            </div>
                        </div>

                        <!-- <pe:if condition='<%= TypeBeExpand(XPath("this|isMidleMenu")) == true %>'>
                            <div style="margin-left:5px;margin-top:5px;height:32px;width:96px;background:url(Texture/Aries/Creator/keepwork/Mall/btn_qiehuan2_32X32_32bits.png#0 0 32 32:8 8 8 8)">
                                <input type="button" value='' name='<%=XPath("this|index") %>' style="position:relative;margin-left:5px;width:96px;height:32px;font-weight:bold;background:" />
                                <div style="float:left;margin-left: -20px;margin-top: 3px;">
                                    <div style="position:relative;text-align:center;color: #f8f8f8;"><%=XPath("this|text") %></div>
                                    <pe:if condition='<%= TypeBeExpand(XPath("this|expanded")) == false %>'>
                                        <div style="position:relative;margin-left:97px;margin-top:7px;width:9px;height:13px;background:url(Texture/Aries/Creator/keepwork/Mall/icon_qiehuan3_9X13_32bits.png#0 0 9 13);" />
                                    </pe:if>
                                    <pe:if condition='<%= TypeBeExpand(XPath("this|expanded")) == true %>'>
                                        <div style="position:relative;margin-left:97px;margin-top:7px;width:13px;height:9px;background:url(Texture/Aries/Creator/keepwork/Mall/icon_qiehuan4_13X9_32bits.png#0 0 13 9);" />
                                    </pe:if>
                                </div>
                            </div>
                        </pe:if> -->
                    </div>
                </NodeTemplate>
                <NodeTemplate DataType="item">
                    <div style="margin-left:5px;margin-top:5px;height:32px;width:96px;background:">
                        <div style="float:left;margin-left: -20px;margin-top: 3px;">
                            <!-- <div style="position:relative;text-align:center;color: #181818;"><%=XPath("this|text") %></div> -->

                            <pe:if condition='<%= ItemBeSelected(XPath("this|type_index"),XPath("this|menu_item_index")) %>'>
                                <input type="button" value='<%=XPath("this|text") %>' name='<%=XPath("this|text") %>' onclick="" param1='<%= XPath("this") %>' param2='<%= XPath("this|menu_item_index") %>' style="margin-left: 3px; width:96px;height:32px;color:#181818;text-align:center;background:url(Texture/Aries/Creator/keepwork/Mall/btn_qiehuan3_32X32_32bits.png#0 0 32 32:8 8 8 8)"/>
                            </pe:if>
                            <pe:if condition='<%= not ItemBeSelected(XPath("this|type_index"),XPath("this|menu_item_index")) %>'>
                                <input type="button" value='<%=XPath("this|text") %>' name='<%=XPath("this|text") %>' onclick="ChangeMenuItem" param1='<%= XPath("this") %>' param2='<%= XPath("this|menu_item_index") %>' style="margin-left: 3px; width:96px;height:32px;color:#181818;text-align:center;background:url(Texture/Aries/Creator/keepwork/Mall/btn_qiehuan_32X32_32bits.png#0 0 32 32:8 8 8 8)"/>
                            </pe:if>

                            
                        </div>
                    </div>

                    <!-- <div style="height:40px;margin-left:2px;">
                        <pe:if condition='<%= ItemBeSelected(XPath("this|type_index"),XPath("this|menu_item_index")) %>'>
                            <div style="margin-top:5px;width:200px;height:26px;font-weight:bold;text-align:left;">
                                <div style="float: left; width: 6px;height: 6px;margin-top: 10px;;background: url(Texture/Aries/Creator/keepwork/Mall/icon_qiehuan4_6X6_32bits.png#0 0 6 6);"></div>
                                <input type="button" value='<%=XPath("this|text") %>' name='<%=XPath("this|text") %>' onclick="ChangeMenuItem" param1='<%= XPath("this") %>' param2='<%= XPath("this|menu_item_index") %>' style="margin-left: 3px; width:190px;height:26px;color:#fcc139;text-align:left;background:"/>
                            </div>
                        </pe:if>
                        <pe:if condition='<%= not ItemBeSelected(XPath("this|type_index"),XPath("this|menu_item_index")) %>'>
                            <div style="margin-top:5px;width:200px;height:26px;font-weight:bold;text-align:left;">
                                <input type="button" value='<%=XPath("this|text") %>' name='<%=XPath("this|text") %>' onclick="ChangeMenuItem" param1='<%= XPath("this") %>' param2='<%= XPath("this|menu_item_index") %>' style="margin-left: 9px; width:190px;height:26px;color:#808080;text-align:left;background:" />
                            </div>
                        </pe:if>
                    </div> -->
                </NodeTemplate>
            </NodeTemplates>
        </pe:treeview>

        <div style="margin-left:35px;margin-top:25px;color:#000000;height: 40px;">
            <div style="float:left;width:30px;height:15px;" >
                <kp:item gsid="998" style="margin-left:-20px;margin-top:-5px;width:64px;height:32px;"/>
            </div>
            <pe:label name="bean_label" style="float:left;margin-left:5px;color:#000000;margin-top: 2px;" value='0'></pe:label>
            <!-- <div name="bean_label" style="float:left;margin-left:2px;color:#000000;"><%=GetExchangeP  -->
        </div>
        
    </div>

    <div style="float:left;width:824px;height:520px;margin-top:0px;background:;">
        <pe:gridview style="margin-left:5px;" name="item_gridview" CellPadding="18" AllowPaging="false" ItemsPerLine="4 " DefaultNodeHeight="50"
                     DataSource='<%=GridsItems%>'>
            <PagerSettings Position="Bottom" height="36" style="position:relative;width:824px;margin-top:-30px;height:32px;" PreviousPageText="previous page" NextPageText="next page"/>
            <PagerTemplate>
                <form>
                    <input type="button" name="pre" zorder="2" style="width:20px;height:20px;margin-left:348px;margin-top:15px;background-rotation:-1.57;background:url(Texture/Aries/Creator/keepwork/Mall/icon_arrow_1_32bits.png#0 0 16 16);"/>
                    <div style="float:left;margin-top:10px;text-singleline:true">
                        <label name="page" style="color:#000000;text-align:center;width:45px;height:18px;margin:4px"/>
                    </div>
                    <input type="button" name="next" zorder=2 style="width:20px;height:20px;margin-top:17px;background-rotation:1.57;background:url(Texture/Aries/Creator/keepwork/Mall/icon_arrow_1_32bits.png#0 0 16 16)"/>
                </form>
            </PagerTemplate>
            <Columns>
                    <!-- <div style="width:140px;height:93px;background:url(Texture/Aries/HaqiShop/bg.png#0 0 16 16:5 5 5 5);"></div> -->
                    <div style="width:170px;height:170px;background:url(Texture/Aries/Creator/keepwork/Mall/kuang_170X170_32bits.png#0 0 170 170)">
                        <div style="position:relative;">
                            <div style="width:170px;height:108px;background:;">
                                <!-- <pe:item zorder="2" onclick="" isdragable="false" gsid='<%=2408%>' tooltip = '<%=Eval("description")%>' icon = "" showdefaulttooltip="false" background="Texture/Aries/Creator/keepwork/Mall/bg_item_32bits.png#0 0 28 28:5 5 10 10" style="margin-left:0px;width:54px;height:54px;" /> -->
                                <div style="position:relative;width:123px;">
                                    <div style="position:relative;margin-left:21px;margin-top:18px;">
                                        <img zorder="0" src='<%=Eval("icon")%>'width="128" height="64"/>
                                    </div>
    
                                    <div style="margin-left: -5px; margin-top: -5px;">
                                        <pe:if condition='<%=Eval("is_show_latest_tag") %>'>
                                            <div zorder="1" style="float: left;margin-top:0px;width:31;height:29px;background:url(Texture/Aries/Creator/keepwork/Mall/icon_new_31X29_32bits.png#0 0 31 29:0 0 0 0);"></div>
                                        </pe:if>   
                                        <pe:if condition='<%=Eval("is_show_hot_tag") %>'>
                                            <div zorder="1" style="float: left;margin-top:0px;width:28px;height:34px;background:url(Texture/Aries/Creator/keepwork/Mall/icon_hot_28X34_32bits.png#0 0 28 34);"></div>
                                        </pe:if> 
                                    </div>
                               
                                </div>
                                
                                <!-- <div style="position:relative;width:123px">
    
                                </div> -->
                                
                                <pe:if condition='<%=Eval("isVip") %>'>
                                    <div zorder="1" style="margin-top:2px;margin-left:136px;width:33;height:33;background:url(Texture/Aries/Creator/keepwork/Mall/tag_vip.png#0 0 33 33:0 0 0 0);"></div>    
                                </pe:if>      
                                      
                                <!-- <div>
                                    <input type="button" class="button" onclick="" name='<%=0 %>' style="width:123px;height:115px;" background="" tooltip='<%=Eval("description")%>'/>
                                </div> -->
                                <!-- <div style="position:relative;margin-top:-17px;padding-left:-3px;height:12px;;font-size:12;color:#ffffff;"><%=Eval("tag_desc") %></div> -->
                                <!-- <pe:if condition='<%=not IsRightSchool(Eval("gsid")) %>'></pe:if>
                                <pe:if condition='<%=not IsRightSchool(Eval("gsid")) %>'></pe:if> -->
                            </div>
                            <div style="margin-top:0px;width: 163px; height:26px;background:url(Texture/Aries/Creator/keepwork/Mall/zidi_163X26_32bits.png#0 0 163 26);">
                                <div style="position:relative;margin-top: 3px; width: 163px; height:20px; font-weight:bold;font-size:12;color:#ffffff;text-align: center;">
                                    <%=Eval("name") %>
                                </div>

                                <pe:if condition='<%=not Eval("enabled")%>'>
                                    <div style="margin-left: 3px; margin-top:-105px;width: 164px; height:131px;background:url(Texture/Aries/Creator/keepwork/Mall/yishirongan_64X64_32bits.png#0 0 64 64:16 16 16 16);"></div>
                                </pe:if>
                            </div>

    
                            <pe:if condition='<%=IsShowFlag(XPath("this"))%>'>
                                <pe:if condition='<%=Eval("show_state") == 4%>'>
                                    <div style="margin-left: 32px; margin-top:7px;width: 101px; height:19px;background:url(Texture/Aries/Creator/keepwork/Mall/btn_huiyuan_101X19_32bits.png#0 0 101 19);"></div>
                                </pe:if>
                                <pe:if condition='<%=Eval("is_sell")%>'>
                                    <div style="margin-left: 52px; margin-top:9px;width: 63px; height:18px;background:url(Texture/Aries/Creator/keepwork/Mall/zi_shouwan_63X18_32bits.png#0 0 63 18);"></div>
                                </pe:if>
                                <pe:if condition='<%=Eval("is_has")%>'>
                                    <div style="margin-left: 52px; margin-top:9px;width: 61px; height:17px;background:url(Texture/Aries/Creator/keepwork/Mall/btn_keyong_61X17_32bits.png#0 0 61 17);"></div>
                                </pe:if>
                                <pe:if condition='<%=Eval("can_use")%>'>
                                    <div style="margin-left: 3px; margin-top:-3px;width: 164px; height:36px;background:url(Texture/Aries/Creator/keepwork/Mall/btn_keshiyong_164X36_32bits.png#0 0 164 36);"></div>
                                </pe:if>
                                <pe:if condition='<%=Eval("is_use")%>'>
                                    <div style="margin-left: 42px; margin-top:9px;width: 87px; height:21px;background:url(Texture/Aries/Creator/keepwork/Mall/btn_yishiyong_87X21_32bits.png#0 0 87 21);"></div>
                                </pe:if>
                                <!-- <input type="button" class="button" value='<%=Eval("buy_txt")%>' enabled='true' onclick="OnclickBuy()" param1='<%= XPath("this") %>' style="position:relative;margin-left:105px;margin-top:7px;font-size:12px;width:50px;"/> -->
                            </pe:if>
    
                            <pe:if condition='<%=not IsShowFlag(XPath("this"))%>'>
                                <div style="position:relative;margin-top:5px;margin-left:58px;padding-left:5px;font-size:12px;">
                                    <pe:if condition='<%=Eval("is_cost_bean") %>'>
                                        <div style="margin-top:1px;float:left;width:22;height:21;background:url(Texture/Aries/Creator/keepwork/Mall/icon_douzi_22X21_32bits.png#0 0 22 21:0 0 0 0);"></div> 
                                        <!-- <pe:textsprite fontName="MallCost" name = "time_text_sprite_h" value = '<%=Eval("cost_desc")%>' style="width:50px;margin-left:0px;margin-top:0px;font-size:22;" /> -->
                                    </pe:if>
                                     
                                    <pe:if condition='<%=Eval("is_cost_coin") %>'>
                                        <div style="margin-top:3px;float:left;width:20;height:20;background:url(Texture/Aries/Creator/keepwork/Mall/icon_coin_32bits.png#0 0 14 14);"></div>  
                                        <!-- <pe:textsprite fontName="MallCost" name = "time_text_sprite_h" value = '<%=Eval("cost_desc")%>' style="width:50px;margin-left:0px;margin-top:0px;font-size:22;" /> -->
                                    </pe:if>
                                    
                                    <pe:if condition='<%=IsOnlyNumber(Eval("cost_desc")) %>'>
                                        <pe:textsprite fontName="MallCost" imagePath="Texture/mall_number_119X95_32bits.png" name = "" value = '<%=Eval("cost_desc")%>' style="width:50px;margin-left:5px;margin-top:3px;font-size:17pt;" />
                                    </pe:if>

                                    <pe:if condition='<%=not IsOnlyNumber(Eval("cost_desc")) %>'>
                                        <div style="margin-left:5px;margin-top:1px;float:left;height:20px;color:#000000;font-weight:bold;font-size: 16pt;"><%=Eval("cost_desc")%></div>
                                    </pe:if>
                                    
                                </div>
                            </pe:if>
                            <!-- <pe:if condition='<%=Eval("enabled")%>'>
                                <input type="button" class="button" value='<%=Eval("buy_txt")%>' enabled='true' onclick="OnclickBuy()" param1='<%= XPath("this") %>' style="position:relative;margin-left:105px;margin-top:7px;font-size:12px;width:50px;"/>
                            </pe:if>
                            <pe:if condition='<%=not Eval("enabled")%>'>
                                <input type="button" class="button" value='<%=Eval("buy_txt")%>' enabled="false" onclick="OnclickBuy()" param1='<%= XPath("this") %>' style="position:relative;margin-left:105px;margin-top:7px;font-size:12px;width:50px;"/>
                            </pe:if> -->
                        </div>

                        <input type="button" value='' onclick="OnclickBuy()" param1='<%= XPath("this") %>' style="position:relative;margin-left:0px;margin-top:0px;font-size:12px;width:170px;height: 170px;background: ;"/>
                    </div>
            </Columns>
            <EmptyDataTemplate>
            </EmptyDataTemplate>
        </pe:gridview>
    </div>
</div>

        </kp:window>
    </pe:mcml>
</body>
</html>

